Field of Disclosure
The present disclosure relates to a debugging system and method. More particularly, the present disclosure relates to a debugging system and method applied in an embedded device.
Description of Related Art
Since embedded devices have characteristics of small size, light-weight, low power consumption and low cost, embedded devices are very popular in the market of consumer electronics products. Because most embedded devices lack components such as keyboard, screen and hard drive, during development of the application program for the embedded device (such as a microcontroller or a chip, etc.), the developers often need to output the debugging information generated during the operations of the program, to a debugging device having the aforementioned components for display, so as to facilitate the debugging work.
There are two common ways for outputting the debugging information, in which one is that the embedded device instantly transmits the debugging information to the debugging device via a universal asynchronous receiver/transmitter. However, because of cost considerations, many embedded devices under development do not have the universal asynchronous receiver/transmitters.
Another way of outputting the debugging information is, through input/output pins of a general embedded device, to use a semihosting mechanism to transmit the debugging information to the debug device. The semihosting mechanism is a software debugging mechanism. The embedded device interrupts the running program via a software manner, and then the debug device receives an interrupt notice and obtains the debugging information from the embedded device. The embedded device terminates the interruption and resumes operation after the debug end obtains the debugging information. Although no universal asynchronous receiver/transmitter is needed in the latter, the operations of the programs will be interrupted while the debug device obtains the debugging information, thereby reducing the debugging efficiency.